package nsoft.swing.component;

import javax.swing.JTextField;

public class NTextField extends JTextField implements BeanBinder {

	/**
	 * serialVersionUID = 1L.
	 */
	private static final long serialVersionUID = 1L;
	private NTextDocument document;

	public NTextField(Object bean, String property) {
		document = new NTextDocument(bean, property);
		setDocument(document);
	}

	public Object getBean() {
		return document.getBean();
	}

	public void setBean(Object bean) {
		document.setBean(bean);

	}

	public boolean updateBean() {
		return document.updateBean();
	}

	public boolean updateFromBean() {
		return document.updateFromBean();
	}

}
